import { createApp } from 'vue';
import App from './App.vue';
import '../registerServiceWorker';
import router from '../router';
import store from '../store';
import ElementPlus from 'element-plus';
import zhCn from 'element-plus/es/locale/lang/zh-cn';
// import "./assets/element-variables.scss";
import 'element-plus/theme-chalk/index.css';
import '../assets/index.css';
import '../assets/ali-icons/iconfont.css';
import { commitLogin, hasLogin } from '../utils/cookie';

// commitLogin();

if (hasLogin()) {
  createApp(App)
    .use(store)
    .use(router)
    .use(ElementPlus, { size: 'small', locale: zhCn })
    .mount('#app');
} else {
  window.location.href = `${window.location.origin}/login.html?/#`;
}
